import request from '@/utils/requst'
import axios from "axios";

export function download(url,params) {
    return axios({
        baseURL: '', // api 的 base_url
        timeout: 120000, // request timeout
        withCredentials: true,
        url: url,
        method: 'post',
        params: params,
        responseType:'blob',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}

export function post(url, params) {
    return request({
        url: url,
        method: 'post',
        data: params,
        headers: {
            "Content-Type": "application/json;charset=UTF-8"
        }
    })
}


export function postFormDataAction(url, formData) {
    return request({
        url: url,
        method: 'post',
        params: formData,
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}
export function postFormAction(url, formData) {
    return request({
        url: url,
        method: 'post',
        data: formData,
        headers: {
            "Content-Type": "multipart/form-data"
        },
        emulateJSON: true
    })
}